﻿<Window x:Class="Mido.UiModules.SaveDialogModule.SaveDialogWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:Mido.Properties"
        xmlns:converters="clr-namespace:Mido.Utils.Converters"
        xmlns:Imaging="clr-namespace:System.Drawing.Imaging;assembly=System.Drawing"
        Height="165" Width="600"
        ResizeMode="CanResizeWithGrip"
        WindowStyle="None"
        AllowsTransparency="True"
        WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
    <Window.Resources>
        <converters:EnumBooleanConverter x:Key="EnumBooleanConverter" />
    </Window.Resources>
    <Border Margin="0,1,0,1" BorderBrush="{DynamicResource DefaultAppBrush}" BorderThickness="1" RenderTransformOrigin="0.5,0.5" Background="#FFF0F0F0">
        <Border.Effect>
            <DropShadowEffect
                Opacity="0.999"
                BlurRadius="16"
                ShadowDepth="0" />
        </Border.Effect>
        <DockPanel>
            <Grid DockPanel.Dock="Top"
                  x:Name="LayoutRoot"
                  MouseDown="DragableGridMouseDown"
                  Background="{DynamicResource DefaultAppBrush}">
                <Grid 
                    x:Name="HeaderGrid" 
                    Height="25" 
                    VerticalAlignment="Top">
                    <Grid
                        x:Name="DragableArea"
                        MouseDown="DragableGridMouseDown"/>
                    <TextBlock
                            x:Name="Minimize4Button"
                            Text="Save"
                            Margin="10,0"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center" FontSize="16" Foreground="White" RenderTransformOrigin="0.5,0.5">
                    </TextBlock>

                    <StackPanel
						Grid.Column="1"
                        Orientation="Horizontal"
                        Margin="0,5,5,0"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Top"
                        Background="{DynamicResource DefaultAppBrush}">
                       
                        <Button
                            Style="{DynamicResource SystemButton}" 
                            x:Name="CloseButton"
                            Content="r"
                           Click="CloseButton_Click" />
                    </StackPanel>
                </Grid>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <!--			<RowDefinition Height="100"/>-->
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
            </Grid>
            <Border DockPanel.Dock="Top" BorderBrush="#FFE5E5E5" BorderThickness="0,0,0,1">
                <Grid>                 
                        <Grid Margin="6">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <!--			<RowDefinition Height="100"/>-->
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                        <TextBlock Text="{x:Static Properties:Resources.SaveDialogWindow_Save_In}" VerticalAlignment="Center"></TextBlock>
                            <TextBox Grid.Column="1" Margin="3" Text="{Binding Model.DestinitionFolder}"></TextBox>
                        <TextBlock Grid.Row="1" Text="{x:Static Properties:Resources.SaveDialogWindow_Format}" VerticalAlignment="Center"></TextBlock>
                        <StackPanel Grid.Row="1" Margin="3" Grid.Column="1" VerticalAlignment="Center" Orientation="Horizontal">
                            <RadioButton Margin="3,0" IsChecked="{Binding Path=Format, 
                            Converter={converters:EnumBooleanConverter}, 
                            ConverterParameter={x:Static Imaging:ImageFormat.Jpeg}}">Jpeg</RadioButton>
                            <RadioButton Margin="3,0" IsChecked="{Binding Path=Format, 
                            Converter={converters:EnumBooleanConverter}, 
                            ConverterParameter={x:Static Imaging:ImageFormat.Png}}">Png</RadioButton>
                            <RadioButton Margin="3,0" IsChecked="{Binding Path=Format, 
                            Converter={converters:EnumBooleanConverter}, 
                            ConverterParameter={x:Static Imaging:ImageFormat.Bmp}}">Bmp</RadioButton>
                            <RadioButton Margin="3,0" IsChecked="{Binding Path=Format, 
                            Converter={converters:EnumBooleanConverter}, 
                            ConverterParameter={x:Static Imaging:ImageFormat.Gif}}">Gif</RadioButton>
                        </StackPanel>
                            
                        <Button Grid.Column="2" Content="{x:Static Properties:Resources.SaveDialogWindow_Browse}" Command="{Binding ChooseSaveFolderCommand}"></Button>
                        <CheckBox IsChecked="{Binding CreateSubfolder}" Grid.Row="2" Margin="3" Grid.Column="1" Content="{x:Static Properties:Resources.SaveDialogWindow_Save_to_subfolder}"></CheckBox>
                        <CheckBox IsChecked="{Binding OpenDestinitionFolder}" Grid.Row="3" Margin="3" Grid.Column="1" Content="{x:Static Properties:Resources.SaveDialogWindow_Open_After_Finish}"></CheckBox>
                        <ProgressBar x:Name="progress" Value="{Binding Progress}" Margin="3" Grid.Row="4" Grid.Column="1" Height="15" ></ProgressBar>
                        <Button Grid.Row="4" Grid.Column="2" Content="{x:Static Properties:Resources.SaveDialogWindow_Save}" Command="{Binding SaveCommand}"/>
                    </Grid>
                </Grid>
            </Border>
        </DockPanel>
    </Border>
</Window>
